########### MANUSCRIPT: The Role of Education and Attitudes in Cooking Fuel Choice: Evidence from two states in India
########### JOURNAL: ENERGY FOR SUSTAINABLE DEVELOPMENT
########### AUTHORS: CARLOS F. GOULD/1 AND JOHANNES URPELAINEN/2
########### AFFILIATIONS: 1/COLUMBIA UNIVERSITY MAILMAN SCHOOL OF PUBLIC HEALTH AND 2/JOHNS HOPKINS SCHOOL OF ADVANCED INTERNATIONAL STUDIES
########### PURPOSE: THIS IS THE MAIN CODE (#0) THAT DRAWS ON OTHER CODES AVAILABLE IN THIS REPLICATION ARCHIVE TO CARRY OUT ANALYSES


#########################
##### LIBRARIES #########
#########################

packages_needed <- c("tidyverse",
                     "haven", 
                     "gridExtra", 
                     "car", 
                     "arsenal", 
                     "broom",
                     "margins",
                     "poliscidata",
                     "cowplot",
                     "xtable",
                     "poliscidata",
                     "tmap",
                     "rgdal",
                     "broom",
                     "dotwhisker",
                     "survival",
                     "GGally",
                     "stargazer"
       
)

for (i in 1:length(packages_needed)){
  if(!(packages_needed[i] %in% installed.packages())){install.packages(packages_needed[i])}
}


for (i in 1:length(packages_needed)){
  library( packages_needed[i], character.only = TRUE)
}


# set the project location

setwd("~/Dropbox/Kerala Rajasthan/Data/Replication Archive/")


#########################
##### EXTERNAL SCRIPTS ##
#########################

# (Note: The present script is "Code 0")


####
#### Code 1: Loads data, makes variables, creates subsets -----------
####

source("Code/1_GouldUrpelainen_Processing.R")



####
#### Code 2: Generates descriptive tables -----------
####

source("Code/2_GouldUrpelainen_DescriptiveTables.R")



####
#### Code 3: Makes descriptive figures -----------
####

source("Code/3_GouldUrpelainen_DescriptiveFigures.R")




####
#### Code 4: Makes descriptive maps -----------
####

source("Code/4_GouldUrpelainen_DescriptiveMaps.R")



####
#### Code 5: Runs regressions and generates figures used in the main text
####

source("~Code/5_GouldUrpelainen_MainRegressions_Figures.R")





####
#### Code 6: Runs regressions and generates figures used in the supporting information -----------
####

source("~/Code/6_GouldUrpelainen_SupportingRegressions_Figures.R")




